import React from "react";
import LoginView from "./LoginView";
import * as loginAction from "../../redux/actions/login";
import {useDispatch} from "react-redux";

const Login=()=>{
    const dispatch=useDispatch()
    function loginHandle(user){
        dispatch(loginAction.set_login(user))
        window.history.back()
    }
    return (
         <LoginView onLoginEvent={loginHandle}/>
    )
}
export default Login